<template>
	<view>
		<view class="smart-panel-head">
		            <view class="smart-panel-head-title">navigator</view>
		        </view>
		        <view class="smart-padding-wrap">
		                <navigator url="/pages/components/newpapes/newpapes">
		                    <button type="default">跳转到新页面</button>
		                </navigator>
		                <navigator url="newpapes/newpapes?title=redirect" open-type="redirect" hover-class="other-navigator-hover">
		                    <button type="default">在当前页打开</button>
		                </navigator>
						<navigator url="redirect/redirect" open-type="reLaunch" >
						    <button type="default">新建调用栈</button>
						</navigator>
		                <navigator  url="/pages/tabBar/tabcompage/tabcompage" open-type="switchTab" hover-class="other-navigator-hover">
		                    <button type="default">跳转到tab页面</button>
		                </navigator>
						<view @click="goRef()">
						    <button type="default">自动刷新</button>
						</view>
		            </view>
		        </view>
	
</template>

<script>
	export default {
		data() {
			return {
				title:'navigator',
				user:"qsq",
				uid:455555,
				list:[1,2,3],
				
			}
		},
		onLoad(options){
			console.log("navigator页面加载");
			},
		onShow() {
			console.log("-------onShow");
		},
		onReady() {
			console.log("-------onReady");
			
		},
		onHide() {
			console.log("--------onHide");
		},
		onUnload() {
			console.log("--------onUnload");
		},
		onPullDownRefresh() {
			console.log("-------onPullDownRefresh开始刷新");
			// 数据更新
			setTimeout(()=>{
				uni.stopPullDownRefresh();
				console.log("--------刷新完成");
			},2000)
			
		},
		onReachBottom(){
			console.log("到底了------");
			this.count=this.count+20;
		},
		methods: {
			goRef(){
				uni.startPullDownRefresh({
					success() {
						console.log("-------success");
					},
					fail(){
						console.log("------fail");
					},complete() {
						console.log("------complete");
					}
				})
			
			},
		}
	}
</script>

<style>
button{
	margin: 30rpx;
}
</style>
